#include <iostream>
#include <string>
#include <cctype>
using namespace std;
int sum;
int main()
{
	int n;
	cin >> n;
	int tmp = n;
	while(tmp)
	{
		int t = tmp%10;
		sum+=t*t*t;
		tmp/=10;
	}
	if(sum == n)
	cout << "YES" << endl;
	else
	cout << "NO" << endl;
    
}
